var login = new Vue({
	el: '#login',
	data: {
		username: '',
		password: '',
		islogin:false,
		areas:[]
	},
	watch: {

	},
	mounted: function() {

	},
	methods: {
		login: function() {
			var _this = this
				axios({
				url: sever + '/mlogin',
				method: 'POST',
				// 请求体重发送的数据
				params: {
					username: _this.username,
				    password: _this.password
				},
				timeout: 50000,
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				}
			}).then(function(res){ 
				//设置登录后参数
				localStorage.setItem("shs_status",res.data.status)
				_this.islogin = res.data.status
				//查询可选地区
				_this.getArea()
			})

		},
		getArea:function(){
			this.areas =[
				{"value":"087d8999920e4bf79a996fa386831003",	"text":"山坡村委会"},
				{"value":"0cacb43906324d65b8ee32a2e6e556c8",	"text":"西街社区"},
				{"value":"0e823c868a3740b7871eb5b3553326ad",	"text":"新庄村委会"},
				{"value":"0edbe94364f44313898088e44cc63754",	"text":"昌河村委会"},
				{"value":"11b744db0a1a4199868a3e65370048a4",	"text":"王朝村委会"},
				{"value":"15b9ff513c7d497b8cd545e455933585",	"text":"草海村委会"},
				{"value":"17743a92d8294cdb892514bfac9cba1a",	"text":"北街社区"},
				{"value":"1824a2ea431f40b68088f8a3b577786a",	"text":"石河村委会"},
				{"value":"24244a6d2cfe4ec69e8bd49d6261e3ec",	"text":"地角村委会"},
				{"value":"242f9e7be4194706a720d0718c1ae067",	"text":"竹园村委会"},
				{"value":"283f48d9a5ac4f18830c39a30d9c83fd",	"text":"后营村委会"},
				{"value":"2ecec1cec8e647c389a77b86b743984a",	"text":"马草地村委会"},
				{"value":"30882f1542a043db9f9c1b1f4929e6eb",	"text":"清河村委会"},
				{"value":"337e18f414f74fddb7deb0eae3ca1d5a",	"text":"官庄村委会"},
				{"value":"342482e4dae347c4925673c54fcfd91b",	"text":"蒿子箐村委会"},
				{"value":"367ea7621bf94fd1915560cbe9e42c84",	"text":"哔叭村委会"},
				{"value":"3b224e5e02884d37843deb1ebfcc21f0",	"text":"白石地村委会"},
				{"value":"3c34a5e4661b4be7a7fcfdb80baa8ffa",	"text":"龙岗村委会"},
				{"value":"3de1bbdc7a074f469c13458322263fe1",	"text":"上屯村委会"},
				{"value":"43a26e7f1b3a4f209e397a16fdef4533",	"text":"吴海村委会"},
				{"value":"4e0c80cad8d14070a80d235aade8635b",	"text":"长寿村委会"},
				{"value":"516429bef5e540a8b39c4d1bec254601",	"text":"旧城村委会"},
				{"value":"53b94bd614bf4a22a9c57a1f9fa464b8",	"text":"小邑村委会"},
				{"value":"54c6e5660224439886e997373bb12788",	"text":"南街社区"},
				{"value":"56ae5c04d0e14625a0bfe0d3c7eff027",	"text":"新街村委会"},
				{"value":"578882c72d9543adb6a73e15fc6163f2",	"text":"大柏者乐村委会"},
				{"value":"5973077208ef4bdc97ba767690224a76",	"text":"黄泥塘村委会"},
				{"value":"636ef9082d77486d8e4b99aa782f3eb7",	"text":"陈家村委会"},
				{"value":"63b9af24a9bd4667b7f74dbab551a900",	"text":"苤拉村委会"},
				{"value":"640214a0ae2e42f18e1cd73825622b27",	"text":"大村村委会"},
				{"value":"6488aa3c152a4b43917f9ba75bc8d0bd",	"text":"梯子村委会"},
				{"value":"67606bc4b451493f8f426c66312af622",	"text":"老街村委会"},
				{"value":"68f42344c99647fb91ff350e39613f9b",	"text":"福光村委会"},
				{"value":"6c5618c77e924b6b96f45243f3c6e44e",	"text":"太平村委会"},
				{"value":"71428ab6aff0409980d9c81a1fbff6e3",	"text":"木署村委会"},
				{"value":"7326661cd8e84257bc7a62fe638e7f99",	"text":"朱街村委会"},
				{"value":"756c0d54088a4d65be61aae1482211af",	"text":"大龙口村委会"},
				{"value":"7a97d99e24ab4080a59a39362359c544",	"text":"巴拉鲊村委会"},
				{"value":"7bf1526d75074199b032635cfaa9fbad",	"text":"小苴村委会"},
				{"value":"7c21cd0911f246489e082d3668f04da3",	"text":"郭家凹村委会"},
				{"value":"7ca0ec9585df4b76b56a39e2b9f330fe",	"text":"小河村委会"},
				{"value":"827f364cdde4480da443a5126bd0a635",	"text":"仁和村委会"},
				{"value":"8c69431ca1704dfc90d1bb84b740c89b",	"text":"启明村委会"},
				{"value":"918398f98f81482c8bba133bab60ae58",	"text":"徐官坝村委会"},
				{"value":"93cebf345ea74ceba38f23536d5a8013",	"text":"各苴村委会"},
				{"value":"95f8a158399042a797861bf72725a50a",	"text":"月明村委会"},
				{"value":"981cbe3fb78a4cd48f33f6ae640b01fb",	"text":"包粮屯村委会"},
				{"value":"99c2b063e0874333ac6a36dc6c723f3d",	"text":"蜻蛉村委会"},
				{"value":"9e623d96f1d24592bcd4a16d2181215d",	"text":"大河口村委会"},
				{"value":"a6ec01bac9d447bea1ecae8b08a44d27",	"text":"海埂屯村委会"},
				{"value":"a71718778aad4d6a844d1000d6d4528e",	"text":"葡萄村委会"},
				{"value":"aabad6d91c4d4fd6a5baf1d768fcccf5",	"text":"三木村委会"},
				{"value":"ad032cd48d1d4bb5b629bd96dda4a259",	"text":"地索村委会"},
				{"value":"ae73d5dd8b1b4d1cb5d04f7e2fa664f2",	"text":"稗子田村委会"},
				{"value":"b7ea705718da4811aebc0a6018359bd6",	"text":"东街社区"},
				{"value":"b884b515d7c247649efa6333a5567ef7",	"text":"光禄村委会"},
				{"value":"ba507f6eebee4cd59f7f54c0d85e094a",	"text":"江尾村委会"},
				{"value":"bdda8ce912994d55b917cb341661804f",	"text":"连厂村委会"},
				{"value":"c05a6682a3ae48a9bcd4a04ab763afcb",	"text":"班刘村委会"},
				{"value":"c099e27fa8fe4e81945328203a152212",	"text":"红梅村委会"},
				{"value":"c22f6363fc444acfaa8071404cb89bd3",	"text":"海子心村委会"},
				{"value":"c3d26bf12f18463ba7ea56e60615c3a4",	"text":"马游村委会"},
				{"value":"c4a5741c34b848c1b9f42710c340f0aa",	"text":"庄科村委会"},
				{"value":"c7e107bd3e8d4793855c5f700922b804",	"text":"大栎树村委会"},
				{"value":"c827cbdcee3b4369a8887436f2ff62e0",	"text":"蛉丰村委会"},
				{"value":"cc7659202323472cbeb723a9eed71b5f",	"text":"官屯村委会"},
				{"value":"cfd1c02941c14dfe9713c4c876e95064",	"text":"仰拉村委会"},
				{"value":"d0e71eef426e47399db7ff3e2ca5ad6a",	"text":"左门村委会"},
				{"value":"e3703d096fff49819eab23311184de9a",	"text":"麂子村委会"},
				{"value":"e37e37c9360a494cb4c7f373a0aa5c1a",	"text":"适中村委会"},
				{"value":"e63942e705c84c9eac865d1c762b0d2a",	"text":"白龙寺村委会"},
				{"value":"eae8fc490aee4309af18925716d47bbc",	"text":"涟水村委会"},
				{"value":"eb9ecb1df76c4f618306cb189b7dde46",	"text":"弥兴村委会"},
				{"value":"ed72ea73bfb34de58d69241fec79a5b3",	"text":"大苴村委会"},
				{"value":"f13c210d811a4efb95447b16decbde22",	"text":"新民村委会"},
				{"value":"f6cce89d4fd84a2095f6faba173b2531",	"text":"三角村委会"}
			]
			
		},
		areachange:function(){
			var selected = $('#grantrole').val()
			console.log(selected)
			for(var i=0;i<this.areas.length;i++){
				if(this.areas[i].text==selected){
					localStorage.areaId = this.areas[i].value
					localStorage.areaName = this.areas[i].text
				}
			
			}

		},
		areaselect:function(){
			if(!localStorage.areaId || localStorage.areaId.length <= 0 ){
				alert("请选择查询区域")
				return
			}
			window.location.href = 'index.html'
			
		}
	},
});